package person.tanjinfu.jaegerexample;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class JaegerExampleController {
    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private JaegerExampleService jaegerExampleService;

    @GetMapping
    public String hello() {
        ResponseEntity<String> responseEntity = this.restTemplate.getForEntity("http://localhost:8081/", String.class);
        System.out.println("response:" + responseEntity);
        String hello = this.jaegerExampleService.hello();
        ResponseEntity<String> responseEntity2 = this.restTemplate.getForEntity("http://localhost:8081/", String.class);
        System.out.println("response2:" + responseEntity2);
        return hello;
    }


}
